<?php
class Application_Model_DbTable_address extends Application_Model_DbTable_DomainObject{
	
	protected $_name = 'uuch_address';
	
	public function getMapper(){
		return array('id','state','province','city','street','comment','postcode','linkMan','mobile','phone','default','userId',"type", "eori", "is_main", "province_name", "city_name");
	}
        
        public function  getbyuid($userId){
            $db = $this->getAdapter();
            $filter = $db->quoteInto(' userId = ?', $userId);            
            $rows = $this->fetchAll($filter,'default desc');
            
            $result = array();
            foreach ($rows as $row){
                array_push($result,$this->convertRowToObject($row));                    
            }           
            return $result;
        }
}